Optimal. Leaf size=54 \[ \frac {(A b-a B) (a+b \sin (c+d x))^3}{3 b^2 d}+\frac {B (a+b \sin (c+d x))^4}{4 b^2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {2912, 45}
\begin {gather*} \frac {(A b-a B) (a+b \sin (c+d x))^3}{3 b^2 d}+\frac {B (a+b \sin (c+d x))^4}{4 b^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 2912
Rubi steps
\begin {align*} \int \cos (c+d x) (a+b \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac {\text {Subst}\left (\int (a+x)^2 \left (A+\frac {B x}{b}\right ) \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {(A b-a B) (a+x)^2}{b}+\frac {B (a+x)^3}{b}\right ) \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {(A b-a B) (a+b \sin (c+d x))^3}{3 b^2 d}+\frac {B (a+b \sin (c+d x))^4}{4 b^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 41, normalized size = 0.76 \begin {gather*} \frac {(a+b \sin (c+d x))^3 (4 A b-a B+3 b B \sin (c+d x))}{12 b^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 73, normalized size = 1.35
method | result | size |
derivativedivides | \(\frac {\frac {B \,b^{2} \left (\sin ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (A \,b^{2}+2 B a b \right ) \left (\sin ^{3}\left (d x +c \right )\right )}{3}+\frac {\left (2 A a b +B \,a^{2}\right ) \left (\sin ^{2}\left (d x +c \right )\right )}{2}+\sin \left (d x +c \right ) a^{2} A}{d}\) | \(73\) |
default | \(\frac {\frac {B \,b^{2} \left (\sin ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (A \,b^{2}+2 B a b \right ) \left (\sin ^{3}\left (d x +c \right )\right )}{3}+\frac {\left (2 A a b +B \,a^{2}\right ) \left (\sin ^{2}\left (d x +c \right )\right )}{2}+\sin \left (d x +c \right ) a^{2} A}{d}\) | \(73\) |
risch | \(\frac {\sin \left (d x +c \right ) a^{2} A}{d}+\frac {\sin \left (d x +c \right ) A \,b^{2}}{4 d}+\frac {\sin \left (d x +c \right ) B a b}{2 d}+\frac {\cos \left (4 d x +4 c \right ) B \,b^{2}}{32 d}-\frac {\sin \left (3 d x +3 c \right ) A \,b^{2}}{12 d}-\frac {\sin \left (3 d x +3 c \right ) B a b}{6 d}-\frac {\cos \left (2 d x +2 c \right ) A a b}{2 d}-\frac {\cos \left (2 d x +2 c \right ) B \,a^{2}}{4 d}-\frac {\cos \left (2 d x +2 c \right ) B \,b^{2}}{8 d}\) | \(151\) |
norman | \(\frac {\frac {2 \left (9 a^{2} A +4 A \,b^{2}+8 B a b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {2 \left (9 a^{2} A +4 A \,b^{2}+8 B a b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {2 \left (2 A a b +B \,a^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 \left (2 A a b +B \,a^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 \left (4 A a b +2 B \,a^{2}+2 B \,b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 a^{2} A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 a^{2} A \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) | \(212\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 74, normalized size = 1.37 \begin {gather*} \frac {3 \, B b^{2} \sin \left (d x + c\right )^{4} + 12 \, A a^{2} \sin \left (d x + c\right ) + 4 \, {\left (2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )^{3} + 6 \, {\left (B a^{2} + 2 \, A a b\right )} \sin \left (d x + c\right )^{2}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 92, normalized size = 1.70 \begin {gather*} \frac {3 \, B b^{2} \cos \left (d x + c\right )^{4} - 6 \, {\left (B a^{2} + 2 \, A a b + B b^{2}\right )} \cos \left (d x + c\right )^{2} + 4 \, {\left (3 \, A a^{2} + 2 \, B a b + A b^{2} - {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 117 vs.
\(2 (46) = 92\).
time = 0.19, size = 117, normalized size = 2.17 \begin {gather*} \begin {cases} \frac {A a^{2} \sin {\left (c + d x \right )}}{d} + \frac {A a b \sin ^{2}{\left (c + d x \right )}}{d} + \frac {A b^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {B a^{2} \sin ^{2}{\left (c + d x \right )}}{2 d} + \frac {2 B a b \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {B b^{2} \sin ^{4}{\left (c + d x \right )}}{4 d} & \text {for}\: d \neq 0 \\x \left (A + B \sin {\left (c \right )}\right ) \left (a + b \sin {\left (c \right )}\right )^{2} \cos {\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 86, normalized size = 1.59 \begin {gather*} \frac {3 \, B b^{2} \sin \left (d x + c\right )^{4} + 8 \, B a b \sin \left (d x + c\right )^{3} + 4 \, A b^{2} \sin \left (d x + c\right )^{3} + 6 \, B a^{2} \sin \left (d x + c\right )^{2} + 12 \, A a b \sin \left (d x + c\right )^{2} + 12 \, A a^{2} \sin \left (d x + c\right )}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.07, size = 71, normalized size = 1.31 \begin {gather*} \frac {{\sin \left (c+d\,x\right )}^2\,\left (\frac {B\,a^2}{2}+A\,b\,a\right )+{\sin \left (c+d\,x\right )}^3\,\left (\frac {A\,b^2}{3}+\frac {2\,B\,a\,b}{3}\right )+\frac {B\,b^2\,{\sin \left (c+d\,x\right )}^4}{4}+A\,a^2\,\sin \left (c+d\,x\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________